package Addition;

import java.lang.reflect.Array;
import java.util.Arrays;

public class MaxOfArrayDemo {
    public static void main(String[] args) {

        int[] arr ={2,9,8,20,3,50};
        int num=0;
        for (int i=0;i<arr.length;i++){
            for (int j=i+1;j<arr.length;j++){
            if (arr[i]>arr[j]){
                num=arr[i];
                arr[i]=arr[j];
                arr[j]=num;
            }
        }
        }
        for (int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }
    }
}
